{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 翻译RDF产生一个映射文件中的英文描述部分\n",
    "\n",
    "import owlready2\n",
    "\n",
    "owlready2.onto_path.append('../w3c/')\n",
    "onto = owlready2.get_ontology('http://www.w3.org/2002/07/owl#')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[]\n",
      "http://www.w3.org/2002/07/owl#\n",
      "<bound method Ontology.get_namespace of get_ontology(\"http://www.w3.org/2002/07/owl#\")>\n"
     ]
    }
   ],
   "source": [
    "print(onto.metadata.comment)\n",
    "print(onto.base_iri)\n",
    "print(onto.get_namespace)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[(302, 6, 80)]\n"
     ]
    }
   ],
   "source": [
    "print(onto.get_triples())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "get_ontology(\"http://www.w3.org/2002/07/owl#\")\n"
     ]
    }
   ],
   "source": [
    "print(onto.get_namespace(onto.base_iri))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "onto.save()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.8.8 ('base')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "40d3a090f54c6569ab1632332b64b2c03c39dcf918b08424e98f38b5ae0af88f"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
